﻿using Customer.Domain;
using Customer.Infrstructre.ClientManager;
using Customer.Read.API.Applcation.Command.ClientCommand;
using MediatR;

namespace Customer.Read.API.Applcation.CommandHandler.ClientCommanfHandler
{
    public class ClientDropCommandhandler : IRequestHandler<ClientDropCommand, List<Client>>
    {
        IClientRepository _clientRep;
        public ClientDropCommandhandler(IClientRepository _clientRep)
        {
            this._clientRep = _clientRep;
        }

        public async Task<List<Client>> Handle(ClientDropCommand request, CancellationToken cancellationToken)
        {
            return await _clientRep.GetAllAsync();
        }
    }
}
